package top.z.work.framework.common.pojo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 分页对象封装
 */
@Data
@Accessors(chain = true)
public class PageInfo<T> implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    public static int DEFAULT_DATA_TOTAL  = 0;
    public static int DEFAULT_PAGE_SIZE   = 20;
    public static int DEFAULT_PAGE_NUMBER = 1;

    // 当前页数据
    private List<T> list  = new ArrayList<>();
    // 当前页码
    private long    page  = DEFAULT_PAGE_NUMBER;
    // 每页数据数量
    private long    size  = DEFAULT_PAGE_SIZE;
    // 总数据数量
    private long    total = DEFAULT_DATA_TOTAL;

}
